<template></template>

<script>
import LOGIN from "@/api/login";
export default {
  data() {
    return {
      code: "",
      msg: "",
    };
  },
  methods: {
    getQueryVariable(variable) {
      var query = window.location.search.substring(1);
      var vars = query.split("&");
      for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {
          return pair[1];
        }
      }
      return false;
    },
  },
  created() {
    this.code = this.getQueryVariable("code");
    var formData = new FormData();
    formData.append("code", this.code);
    localStorage.clear();
    LOGIN.wxloginpcompany(formData)
      .then((res) => {
        localStorage.setItem("ep_Authorization", res.data.data.token);
        window.location.href = "https://www.zsrencai.cn/company/#/resume";
      })
      .catch((error) => {
        this.msg = error;
      });
  },
};
</script>
<style>
</style>